<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="net.sf.json.JSONArray" %>
<%@ page import="com.weavernorth.promotionPlan.pojo.*" %>
<%@ page import="java.util.*" %>
<%@ page import="static com.weavernorth.retailExperienceAward.utils.commonsUtil.convertAmount" %>
<%@ page import="static com.weavernorth.retailExperienceAward.utils.commonsUtil.doubleFormat" %>
<%@ page import="java.text.NumberFormat" %>
<%@ page import="java.math.RoundingMode" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="com.engine.kq.biz.KQFormatData" %>
<%@ page import="weaver.common.DateUtil" %>
<%@ page import="com.alibaba.fastjson.serializer.SerializerFeature" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="static com.weavernorth.util.dateUtils.getEveryday" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
    //刷新考勤汇总报表
    Map<String,Object> msg=new HashMap<>();
    String userId="46727";
    String today = DateUtil.getCurrentDate();
    String kqDate= Util.null2String(request.getParameter("kqdate"),today);//开始日期
    RecordSet rs=new RecordSet();
    String strQuery="SELECT id FROM HRMRESOURCE WHERE STATUS=1 AND WORKCODE is not NULL";
    rs.execute(strQuery);
    Integer rows=0;
    while (rs.next()){
        String strUserid=rs.getString("id");
        String begindate="2021-03-01";
        String endate="2021-03-03";
        List<String> everyday = getEveryday(begindate, endate);//获取日期段每一天
        for (String s : everyday) {
            Map<String, Object> stringObjectMap = new KQFormatData().formatKqDate(strUserid, s);
            rows++;
        }
    }
    msg.put("结果：","执行成功,受影响行数："+rows);
%>
<head>
    <script>
        function btnSubmit() {
            form1.submit();
        }
        jQuery(document).ready(function(){
            $("#json").JSONView($("#json").html(), { expand: true, nl2br: true, recursive_collapser: true });

        });
    </script>
</head>
<body>
    <form name="form1" action="kqflushTest.jsp" method="post">
        <table style="margin: 0 0 0 0">
            <tr style="height: 30px"><td>刷新考勤报表日期:</td><td><input name="kqdate" type="text"/></td></tr>
            <tr>
            <td colspan="2" style="text-align: center;height: 50px;">
                <input type="button" value="执行" onClick="btnSubmit();"/>&nbsp;&nbsp;
            </td>
            </tr>
        </table>
        <div id="json" style="padding-left: 10px">
            执行结果：<%=JSONObject.toJSONString(msg, SerializerFeature.DisableCircularReferenceDetect) %>
        </div>
    </form>
</body>


